<template>
  <Modal
    :active="swapModalActive"
    transfer
    title="交换"
    hide-mask
    draggable
    :width="650"
    :no-footer="true"
    @close="closeBtn"
  >
    <div class="box">
      <div class="selector">
        <!-- <div class="selector-title">Selector</div> -->
        <div class="title">
          <div class="title_color"></div>
          <div class="title_content">Selector</div>
        </div>
        <div class="selector-content">
          <div class="selector-buttons">
            <button class="selector-button active">单元边</button>
            <button class="selector-button icon-button">
              <img src="../../assets/delete.svg" alt="" class="icon imgStyle" />
            </button>
          </div>
        </div>
      </div>
      <div class="foot-box">
        <Button type="primary" size="small" @click="confirm">确定</Button>
        <Button type="default" size="small" @click="closeBtn">取消</Button>
      </div>
    </div>
  </Modal>
</template>
<script setup lang="ts">
import { Modal, Button } from "cax-ui";
import { useMeshEditStore } from "@/UI/store/meshEditStore";
import { storeToRefs } from "pinia";
const meshEditStore = useMeshEditStore();
const { swapModalActive } = storeToRefs(meshEditStore);

function confirm() {
  swapModalActive.value = false;
}
function closeBtn() {
  swapModalActive.value = false;
}
</script>
<style scoped>
.box {
  padding: 15px;
}

.selector {
  /* border: 1px solid #e0e0e0; */
  border-radius: 4px;
  /* background-color: #f5f5f5; */
  padding: 10px;
}

.selector-title {
  font-size: 16px;
  color: #333;
  margin-bottom: 10px;
}

.selector-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.selector-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
}

.selector-button {
  height: 32px;
  width: 200px;
  padding: 0 15px;
  border: 1px solid #ccc;
  background-color: #fff;
  cursor: pointer;
  outline: none;
}

.selector-button.active {
  background-color: #e6f7a7;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
  /* flex-grow: 1; */
  font-weight: normal;
}

.icon-button {
  width: 32px;
  padding: 3px 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
  border-left: none;
  background-color: #fff;
}

.icon-arrow {
  display: inline-block;
  width: 16px;
  height: 16px;
  position: relative;
}

.icon-arrow::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #1e88e5;
}
.imgStyle {
  width: 100%;
  height: 100%;
}
.title {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0 16px;
  margin-bottom: 16px;

  .title_color {
    width: 4px;
    height: 12px;
    background: #339af0;
    margin-right: 8px;
  }
  .title_content {
    opacity: 1;
    font-family: PingFang SC;
    font-size: 14px;
    font-weight: 600;
    line-height: 22px;
    letter-spacing: 0em;
    font-variation-settings: "opsz" auto;
    /* content/主要一级primary */
    /* 样式描述：--vxp-content-color-primary */
    color: #212529;
  }
}
.foot-box {
  width: 100%;
  height: 40px;
  text-align: right;
}
</style>
